<?php
class Form_itemAttr extends BaseAttr {
	public function Form_itemAttr($attr, $lang=null, $mutil_lang=false){
		parent::BaseAttr($attr, $lang, $mutil_lang);
		
		//初始化值内的数据
		if(!empty($this->values)){
			$types = AttrsModel::get_attr_types();
			$relation_mod = new RelationModel();
			$relations = $relation_mod->get_options();
			foreach ($this->values as &$attr){
				if(isset($types[$attr['type']])){
					$attr_type = $types[$attr['type']];
					$attr['type_name'] = $attr_type['name'];
					if(isset($attr['trait'])){
						if($attr['type'] == 'relation'){
							//关联属性
							$attr['relation_name'] = $relations[$attr['relation']];
						}
						$attr['trait_name'] = $attr_type['trait'][$attr['trait']];
					}
				}else{
					$attr['type_name'] = '未知';
				}
			}
		}
	}


	public function get_post_val(&$getted_post_data){}
}

?>